package main

import (
	maker2 "api/libs/maker"
	"gitee.com/dreamwood/ez-maker/maker"
)

func main() {
	maker2.Prepare()
	ComExcelConfig()
	ComExcelConfigItem()
	ComExcelItemCategory()
}

func ComExcelConfig() {
	c := maker.CreateTable("ComExcelConfig", "导入配置", "tools")
	c.AddName()
	c.AddOneToMany("items", "配置", "ComExcelConfigItem")
	c.Generate()
}

func ComExcelConfigItem() {
	c := maker.CreateTable("ComExcelConfigItem", "配置项", "tools")
	c.AddManyToOne("config", "归属", "ComExcelConfig")
	c.AddName()
	c.AddText("pos", "位置")
	c.AddManyToOne("cat", "项目类型", "ComExcelItemCategory")
	c.Generate()
}

func ComExcelItemCategory() {
	c := maker.CreateTable("ComExcelItemCategory", "项目类型", "tools")
	c.AddName()
	c.AddText("code", "类型编码")
	c.LoadTree()
	c.Generate()
}
